#ifndef DLMLISTS_H_INCLUDED
#define DLMLISTS_H_INCLUDED

#include "common.h"

#include <list>
#include <set>
#include <map>

errorCode addLock(struct lock l);
errorCode tryLock(struct lock l);
errorCode removeLock(pid_t pid, int resource_id);

std::list<struct lock> procLocks(pid_t pid);
std::set<pid_t> procsWithLocks();

void printAllLocks();
void printProcLocks(pid_t pid);
void printProcsWithLocks();

bool addChild(child_data child);
bool removeChild(pid_t pid);
child_data getChild(pid_t pid);

bool addWaiter(lock_waiter waiter);
lock_waiter getFirstWaiter(int resource_id);
bool removeWaiter(pid_t pid);

void addTimerDescriptor(pid_t waiter_pid, timer_descriptor *timer_desc);
timer_descriptor *peekTimerDescriptor(pid_t waiter_pid);
void removeTimerDescriptor(pid_t waiter_pid);

#endif
